import request from '@/utils/request'

// 查询lp公告模板列表
export function listLpAnnouncementTemplate(query) {
  return request({
    url: '/lp/lpAnnouncementTemplate/list',
    method: 'get',
    params: query
  })
}

export function findListNotBus(query) {
  return request({
    url: '/lp/lpAnnouncementTemplate/findListNotBus',
    method: 'get',
    params: query
  })
}

export function listTemplateAndBusinessId(query) {
  return request({
    url: '/lp/lpAnnouncementTemplate/listTemplateAndBusinessId',
    method: 'get',
    params: query
  })
}

// 查询lp公告模板详细
export function getLpAnnouncementTemplate(id) {
  return request({
    url: '/lp/lpAnnouncementTemplate/' + id,
    method: 'get'
  })
}

// 保存lp公告模板
export function saveLpAnnouncementTemplate(data) {
  return request({
    url: '/lp/lpAnnouncementTemplate/save',
    method: 'post',
    data: data
  })
}

// 删除lp公告模板
export function delLpAnnouncementTemplate(id) {
  return request({
    url: '/lp/lpAnnouncementTemplate/' + id,
    method: 'delete'
  })
}

// 选中当前选中为默认模板
export function updateSelectedStatus(id, selected) {
  return request(({
    url: '/lp/lpAnnouncementTemplate/updateSelectedStatus/' + id + '/' + selected,
    method: 'get'
  }))
}

export function getByBusinessId(businessId, businessType) {
  return request({
    url: '/lp/lpAnnouncementTemplate/getByBusinessId/' + businessId + '/' + businessType,
    method: 'get'
  })
}

export function existBusinessId(param) {
  return request({
    url: '/lp/lpAnnouncementTemplate/existBusinessId',
    method: 'get',
    params: param
  })
}
